﻿
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>博客管理系统</title>

    <link href="~/Content/css/login.css" rel="stylesheet" />
    <script src="~/Content/layui/layui.js"></script>
</head>
<body class="login-bg">
    <canvas id="fullstarbg">你的浏览器不支持canvas标签</canvas>
    <div class="login">
        <div class="message">博客系统登录</div>
        <div id="darkbannerwrap"></div>
        <form method="post" class="layui-form" onsubmit="return false;" id="form">
            <input name="userName" placeholder="用户名" type="text" lay-verify="required" class="layui-input">
            <hr class="hr15">
            <input name="pwd" lay-verify="required" placeholder="密码" type="password" class="layui-input">
            <hr class="hr15">
            <input value="登录" lay-submit lay-filter="login" style="width:100%;" type="button" id="btn">
            <hr class="hr20">
        </form>
    </div>
    <script>
        layui.use(['form'], function () {
            $ = layui.$;
            var form = layui.form,
                layer = layui.layer;

            //监听提交
            $("#btn").click(function () {
                var str = $("#form").serialize();
                $.post("/Login/Login", str,
                    function (res) {
                        if (res.Success) {
                            layer.msg(res.Message);
                            window.location.href = "/Home/Index";
                        }
                        else {
                            layer.msg(res.Message);
                        }
                    }, "json")
            });
        });

    </script>


    <!-- 底部结束 -->

</body>
</html>
